﻿using PBO.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PBO.Game.BattleClass
{
    public partial class Pokemon
    {
        private BattleType _type1;
        private BattleType _type2;

        public BattleType Type1
        {
            get
            {
                if (BattleState.roost && (BattleState.TempType1 == BattleType.Flying || _type1 == BattleType.Flying))
                {
                    return BattleState.RoostType;
                }
                return BattleState.TempType1 == BattleType.None ? _type1 : BattleState.TempType1;
            }
            set { BattleState.TempType1 = value; }
        }

        public BattleType Type2
        {
            get
            {
                if (BattleState.roost && (BattleState.TempType2 == BattleType.Flying || _type2 == BattleType.Flying))
                {
                    return BattleState.RoostType;
                }
                return BattleState.TempType2 == BattleType.None ? _type2 : BattleState.TempType2;
            }
            set { BattleState.TempType2 = value; }
        }

        public void SetType(int index, BattleType type)
        {
            switch (index)
            {
                case 1:
                    _type1 = type;
                    break;
                case 2:
                    _type2 = type;
                    break;
            }
        }
    }
}
